home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / daten / ispell / interfaces / shell / spellfile.rexx < prev   
OS/2 REXX Batch file  |  1992-09-27  |  1KB  |  57 lines

  1. /*rx
  2.  *  SpellFile.rexx --- program to spell check a file using the ISpell server
  3.  *  from CLI.
  4.  *  Thanks to Richard A. Gerber (gerber@sirius.astro.uiuc.edu) for
  5.  *  pointing out to me how out of date this thing really was.
  6.  *
  7.  *  Copyright © 1989, 1992  Loren J. Rittle
  8.  *  Use as you will, just document your changes and keep my copyright
  9.  *  notice intact.  Feel free to mail enhancements to me.
  10.  *
  11.  *  Loren J. Rittle
  12.  *  rittle@comm.mot.com
  13.  *  Wed May 13 05:45:54 1992
  14.  */
  15.  
  16. options results
  17. options failat 40
  18.  
  19. if left(address(), 4) ~== 'WSH_' then
  20.   address command
  21.  
  22. if words(arg(1)) = 0 then
  23.   do
  24.     say 'Usage: spellfile file1 file2 ...'
  25.     exit 5
  26.   end
  27.  
  28. if ~show(ports, 'IRexxSpell') then
  29.   do
  30.     'run <nil: >nil: ispell -r >nil: <nil:'
  31.     waitforport 'IRexxSpell'
  32.   end
  33.  
  34. tempname = 't:spellfile'pragma('id')
  35.  
  36. do i = 1 to words(arg(1))
  37.   if ~exists(word(arg(1),i)) then
  38.     do
  39.       say 'spellfile: skipping file' word(arg(1),i) 'because not found.'
  40.       iterate i
  41.     end
  42.   'copy' word(arg(1),i) tempname
  43.   if rc ~= 0 then
  44.     do
  45.       say 'spellfile: skipping file' word(arg(1),i) 'because of above error.'
  46.       iterate i
  47.     end
  48.  
  49.   address 'IRexxSpell' filecheck tempname
  50.   r = result
  51.  
  52.   'type' r
  53.   'delete quiet force' r tempname
  54. end
  55.  
  56. exit 0
  57.